package com.aizuda.boot.modules.business.permission.domain.entity;

import com.aizuda.boot.modules.common.constant.enums.ConditionTypeEnum;
import com.aizuda.boot.modules.common.constant.enums.RelationToParentEnum;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 角色数据隔离条件实体类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("auth_role_data_isolation_condition")
public class RoleDataIsolationConditionEntity {

    /**
     * 条件ID
     */
    @TableId(type = IdType.AUTO)
    @Schema(description = "条件ID")
    private Long conditionId;

    /**
     * 权限ID
     */
    @Schema(description = "权限ID")
    private Long permissionId;

    /**
     * 字段名称
     */
    @Schema(description = "字段名称")
    private String fieldName;

    /**
     * 条件类型
     */
    @Schema(description = "条件类型")
    private ConditionTypeEnum conditionType;

    /**
     * 字段值
     */
    @Schema(description = "字段值")
    private String fieldValue;

    /**
     * 父条件ID，NULL表示根条件
     */
    @Schema(description = "父条件ID，NULL表示根条件")
    private Integer parentConditionId;

    /**
     * 与父条件的逻辑关系
     */
    @Schema(description = "与父条件的逻辑关系")
    private RelationToParentEnum relationToParent;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;
} 